<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="Author" contect="http://www.webqin.net">
    <title>忘记密码</title>
    <link rel="shortcut icon" href="images/favicon.ico" />
    <link type="text/css" href="${pageContext.request.contextPath}/css/css.css" rel="stylesheet" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3-min.js"></script>
    <script type="text/javascript">
        //导航定位
        $(function(){
            // $(".nav li:eq(2) a:first").addClass("navCur")
            //验证手机 邮箱
            $(".selyz").change(function(){
                var selval=$(this).find("option:selected").val();
                if(selval=="0"){
                    $(".sel-yzsj").show()
                    $(".sel-yzyx").hide()
                }
                else if(selval=="1"){
                    $(".sel-yzsj").hide()
                    $(".sel-yzyx").show()
                }
            })
        })
    </script>
</head>

<body>

<div class="content">
    <div class="web-width">
        <div class="for-liucheng">
            <div class="liulist for-cur"></div>
            <div class="liulist for-cur"></div>
            <div class="liulist for-cur"></div>
            <div class="liulist"></div>
            <div class="liutextbox">
                <div class="liutext for-cur"><em>1</em><br /><strong>填写账户名</strong></div>
                <div class="liutext for-cur"><em>2</em><br /><strong>发送验证码</strong></div>
                <div class="liutext for-cur"><em>3</em><br /><strong>身份验证</strong></div>
                <div class="liutext"><em>4</em><br /><strong>修改密码</strong></div>

            </div>
        </div><!--for-liucheng/--> <%--action="${pageContext.request.contextPath}/login/SmsVerifyCode" method="post"--%>
        <form class="forget-pwd" action="${pageContext.request.contextPath}/login/SmsVerifyCode" method="post">
            <dl>
                <dt>验证方式：</dt>
                <dd>
                    <select class="selyz">
                        <option value="0">短信验证</option>

                    </select>
                </dd>
                <div class="clears"></div>
                <
                <dl>
                    <dt>手机校验码：</dt>
                    <dd> <input type="text" class="c_code_msg" id="verifyCode" name="verifyCode" style="margin-right: 10px;" placeholder="请填写收到的验证码！">
                    </dd>


                    <div class="clears"></div>
                </dl>
                <div class="subtijiao"><input type="button" value="提交" onclick="requestJson()" /></div>
            </dl>
        </form>
    </div><!--web-width/-->
</div><!--content/-->
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.10.2.min.js"></script>

<script type="text/javascript">
    function requestJson(){

        var verifyCode =$("#verifyCode").val();//#是id选择器

        if(verifyCode==""){
            alert("验证码不能为空！");
            return false;
        }
        else
        {
            $.ajax({
                type:'post',
                url:'${pageContext.request.contextPath}/login/SmsVerifyCode',
                dataType:"json",//注意使用的是打他dataType，而不是Content-Type
                async: true,
                data:{verifyCode:verifyCode},
                success:function(data){
                    if(data==0){
                        alert("验证成功！")
                        window.location.href ="${pageContext.request.contextPath}/login/inUpdataPassword";
                    }
                    else if(data==1){
                        alert("已超时请重新操作！")
                        window.location.href ="${pageContext.request.contextPath}/user/SMS";
                    }
                    else if(data==2){
                        alert("验证码错误，请重新输入！")

                    }
                    else if(data==3){
                        alert("网络繁忙，请稍后再试！")
                        window.location.href ="${pageContext.request.contextPath}/login/in";

                    }

                }
            });
        }
    }
</script>
<style type="text/css">
    form{margin:200px auto;width:500px;}
    label{font-size:14px;color:#555;line-height:40px;margin-right:10px;}
    input{width:212px;height:38px;border-style:none;padding:0 4px;border:1px solid #C8C8C8;margin-right:10px;outline:none;}
    .msgs{display:inline-block;width:104px;color:#fff;font-size:12px;border:1px solid #0697DA;text-align:center;height:30px;line-height:30px;background:#0697DA;cursor:pointer;}
    form .msgs1{background:#E6E6E6;color:#818080;border:1px solid #CCCCCC;}
</style>


</body>
</html>
